package com.cjz.componentization;

import android.os.Bundle;
import android.util.Log;

import com.alibaba.android.arouter.facade.Postcard;
import com.alibaba.android.arouter.facade.callback.NavCallback;
import com.alibaba.android.arouter.launcher.ARouter;
import com.cjz.common.base.BaseActivity;
import com.cjz.fake_common_library1.FakeLib1;
import com.cjz.fake_common_library2.FakeLib2;

import com.cjz.common.router.RouterPath;

public class MainActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        FakeLib1 fakeLib1 = new FakeLib1();
        fakeLib1.test();

        FakeLib2 fakeLib2 = new FakeLib2();
        fakeLib2.test();

        //不能直接调用组件里的类,因为当组件单独运行时主工程无法导入组件,导致此处找不到组件中的类
//        Intent intent =new Intent(this, ComponentOneActivity.class);
//        startActivity(intent);

        ARouter.getInstance().build(RouterPath.JUMP_TO_COMPONENT_1).navigation(this, new NavCallback() {
            @Override
            public void onLost(Postcard postcard) {
                Log.e("cjz", "如果想运行完整app请修改 config.gradle 的 isAllComponentsMixedIn 为 true !!!");
                Log.e("cjz", "please go to config.gradle change isAllComponentsMixedIn to true!!!");
            }

            @Override
            public void onArrival(Postcard postcard) {

            }
        });

    }
}
